import axios from '@/libs/api.request'

export const addDeploymentByString = (data) => {
  return axios.request({
    url: 'processDefinition/addDeploymentByString',
    method: 'post',
    data
  })
}
export const getDefinitions = (data) => {
  return axios.request({
    url: 'processDefinition/getDefinitions',
    method: 'post',
    data
  })
}
export const getDefinitionXml = (data) => {
  return axios.request({
    url: 'processDefinition/getDefinitionXml',
    method: 'post',
    data,
  })
}
//删除流程实例
export const delDefinition = (data) => {
  return axios.request({
    url: 'processDefinition/delDefinition',
    method: 'post',
    data,
  })
}
//获取流程任务
export const getTasks = (data) => {
  return axios.request({
    url: 'task/getTasks',
    method: 'post',
    data,
  })
}
//审核任务
export const auditTask = (data) => {
  return axios.request({
    url: 'task/auditTask',
    method: 'post',
    data,
  })
}
//查看流程图
export const getAuditedImg = (data) => {
  return axios.request({
    url: 'task/getAuditedImg',
    method: 'post',
    responseType: 'blob',
    data,
  })
}
//获取审核历史
export const getRecords = (data) => {
  return axios.request({
    url: 'taskAuditRecords/getRecords',
    method: 'post',
    data,
  })
}
//任务转办
export const transferTask = (data) => {
  return axios.request({
    url: 'task/transferTask',
    method: 'post',
    data,
  })
}
//流程撤回
export const recallProcess = (data) => {
  return axios.request({
    url: 'task/recallProcess',
    method: 'post',
    data,
  })
}
